'use strict'
import Vue from 'vue'

export function confirm (message, title = '提示') {
  let confirm = Vue.prototype.$confirm(message, title, {
    showCancelButton: true,
    showConfirmButton: true,
    closeOnPressEscape: false,
    closeOnClickModal: false,
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  })
  return new Promise((resolve) => {
    confirm.then(resolve).catch(() => {})
  })
}
